﻿using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.Reporting.WebForms;

public partial class ReportRDLC_EMPReport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //rptEmp.ProcessingMode = ProcessingMode.Local;
        //rptEmp.LocalReport.ReportPath = "ReportEmp.rdlc";
        //ReportDataSource rptDataSource = new ReportDataSource("Emp_EmpTable", EmpData.GetEmp());
        //rptEmp.LocalReport.DataSources.Add(rptDataSource);
        //rptEmp.LocalReport.Refresh();
        EmpDataSet ds=new EmpDataSet();
        EmpData.GetEmp(ds);
    }
}
public class EmpData
{
    public EmpData()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public static void GetEmp(EmpDataSet ds)
    {
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = "server=(local);database=Adhocreporting;user id=sa; password=sa123;";
        SqlDataAdapter adp = new SqlDataAdapter();
        adp.SelectCommand = new SqlCommand("select * from employee", conn);
        adp.Fill(ds,"EmpTable");
        
    }
}

